package com.appkubes.mall.restful.application.goods.goods.service.impl;

import com.appkubes.mall.core.entity.MallGoodsExtend;
import com.appkubes.mall.core.service.impl.BaseMallGoodsExtendServiceImpl;
import com.appkubes.mall.restful.application.goods.goods.dao.GoodsExtendDao;
import com.appkubes.mall.restful.application.goods.goods.service.GoodsExtendService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class GoodsExtendServiceImpl extends BaseMallGoodsExtendServiceImpl implements GoodsExtendService {

    @Resource
    GoodsExtendDao goodsExtendDao;

    @Override
    public GoodsExtendDao getDao() {
        return goodsExtendDao;
    }

    @Override
    public MallGoodsExtend get(String goodsKey) {
        MallGoodsExtend query = new MallGoodsExtend();
        query.setGoodsKey(goodsKey);
        List<MallGoodsExtend> extendList = this.selectListByEntity(query);
        if (extendList.size() == 0) return null;
        return extendList.get(0);
    }
}
